<%@page import="board.BoardVo"%>
<%@page import="board.Board"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>modify.jsp</title>

<style>
#viewmain{
	margin:auto;
	width:700px;
}
#modi_subject1,#modi_subject2{
	display:inline-block;
}
#modi_subject1{
	width:100px;
}
#modi_subject{
	width:430px;
	display:inline-block;
	border:2px solid #aaaaaa;
}
#modi_mdate{
	width:255px;
	display:inline-block;
	border:2px solid #aaaaaa;
}
#modi_content{
	width:695px;
	height:400px;
	border:2px solid #aaaaaa;
	
}
#modi_subject3-1,#modi_subject3-2,#modi_subject3-3,#modi_subject3-4,#modi_btn{
	display:inline-block;
}
#modi_btn{
	float:right;
}

</style>

<script src="./board/board.js"></script>
</head>
<body>
<jsp:useBean id="boardVo" class="board.BoardVo"/>
<jsp:setProperty property="*" name="boardVo"/>
<%

Board board = new Board();
board.setVo(boardVo);
BoardVo vo = board.view();


%>

<h2 style="text-align:center;">글 수정</h2>
<form id='viewmain' name='community_form' method='post' action='' enctype='multipart/form-data'>

<div id='modi_subject1'>
	<label>제목</label>
</div>
<div id='modi_subject2'>
	<input type='text' name='subject' style='width:588px' value='<%=vo.getSubject()%>'>
</div>



<div id='modi_content'><textarea cols='96' rows='26' name='content'><%=vo.getContent()%></textarea></div>
<div id='modi_file'>



 <%if(vo.getFilename() == null || boardVo.getFileDelFlag().equals("del")){%>
 
		<input type='file' name='newfilename'>		<!--  insert의 filename을 newfilename으로 변경 -->
		
		<%}else{%> 
			<label ><%=vo.getFilename()%></label>
			<input type='button' value='삭제' onclick="fileDel('del',<%=vo.getSerial() %>)">
		<%}%> 
</div>
<div id='modi_bot'>
<div id='modi_subject3'>
	<div id='modi_subject3-1'>아이디</div>
	<div id='modi_subject3-2'><input type='text' name='mid' value='<%=vo.getMid()%>'></div>
	<div id='modi_subject3-3'>비밀번호</div>
	<div id='modi_subject3-4'><input type='text' name='pwd'></div>
	<div id='modi_btn'>
		<input type='button' id='btnlist' value='목록'>
		<input type='button' id='btnModifyResult' value='수정'>
		
		<input type='hidden' name='filename' value="<%=vo.getFilename()%>">
		<input type='hidden' name='serial' value="<%=vo.getSerial()%>">
		<input type='hidden' name='fileDelFlag' value="<%=boardVo.getFileDelFlag()%>">
		
	</div>
</div>

</form>

<script>init();</script>
</body>
</html>